package com.ipc.app.util.converter;

import com.ipc.app.dal.doObject.AddressDO;
import com.ipc.app.model.Address;

/**
 * @author haijie.zhang
 * 
 */
public class AddressConverter {

	public static AddressDO addressCoreToDO(Address address) {
		AddressDO addressDO = new AddressDO();
		addressDO.setAddressId(address.getAddressId());
		addressDO.setCity(address.getCity());
		addressDO.setDistrict(address.getDistrict());
		addressDO.setProvince(address.getProvince());
		addressDO.setStreet(address.getStreet());
		addressDO.setStreetNumber(address.getStreetNumber());
		addressDO.setX(address.getX());
		addressDO.setY(address.getY());
		addressDO.setType(address.getType());
		addressDO.setInformationID(address.getInformationID());
		addressDO.setPointName(address.getPointName());
		return addressDO;
	}

	public static Address addressDOToCore(AddressDO addressDO) {
		Address address = new Address();
		address.setAddressId(addressDO.getAddressId());
		address.setCity(addressDO.getCity());
		address.setCreateTime(addressDO.getCreateTime());
		address.setDistrict(addressDO.getDistrict());
		address.setModifyTime(addressDO.getModifyTime());
		address.setProvince(addressDO.getProvince());
		address.setStreet(addressDO.getStreet());
		address.setStreetNumber(addressDO.getStreetNumber());
		address.setType(addressDO.getType());
		address.setX(addressDO.getX());
		address.setY(addressDO.getY());
		address.setInformationID(addressDO.getInformationID());
		address.setPointName(addressDO.getPointName());
		return address;
	}
}
